package cn.zhaozhiqi.controller.app;

import cn.zhaozhiqi.pojo.domain.DriverAuthMaterial;
import cn.zhaozhiqi.pojo.dto.AppDriverAuthMaterialDto;
import cn.zhaozhiqi.pojo.query.PageQueryWrapper;
import cn.zhaozhiqi.result.JSONResult;
import cn.zhaozhiqi.result.PageResult;
import cn.zhaozhiqi.service.IDriverAuthMaterialService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Tag(name = "保存司机实名资料",description = "保存司机实名资料")
@RestController
@RequestMapping("/app/driverAuthMaterial")
public class AppDriverAuthMaterialController {

    @Autowired
    public IDriverAuthMaterialService driverAuthMaterialService;

    @Operation( summary= "前端传入的所有参数",description = "前端传入的所有参数保存接口")
    @Parameter(name = "AppDriverAuthMaterialDto",description = "前端传入的的对象",required = true)
    @PostMapping("/save")
    public JSONResult saveDriveAuthMaterial(@RequestBody @Valid AppDriverAuthMaterialDto dto){
        return JSONResult.success(driverAuthMaterialService.saveDriveAuthMaterial(dto));
    }

    @Operation( summary= "后端待认证参数回显",description = "后端待认证参数回显接口")
    @PostMapping("/getAuth")
    public JSONResult getAuthByDriverId(){
        return JSONResult.success(driverAuthMaterialService.getAuthByDriverId());
    }


}
